<section class="comments">
      <h1>评论<span>已有<a class="count" href="${base}/comment.jspx?contentId=${content.id}">
      ${content.commentsCheckedNum!} </a>条</span>
      </h1>
      [#if content.channel.commentControl==0 || ((content.channel.commentControl==1||content.channel.commentControl==3) && user??)]
      <form id="commentForm" action="${base}/comment.jspx" method="post">
      <textarea name="text" placeholder="发表你此时的观点和想法 ……" class="comments-text" id="comments-text"></textarea>
       [#if user??&&user.group.needCaptcha||!user??]
	    <div class="plfr1 clearfix">
	    <div style="float:left;">
	    <input name="captcha" type="text" placeholder="验证码" id="captcha" vld="{required:true}" class="plcode"/>
	    </div>
	    <div style="float:left;">
	    <img id="commentCaptcha" src="${base}/captcha.svl" onclick="this.src='${base}/captcha.svl?d='+new Date()*1"/>
	    </div>
	
	    <div class="down clearfix">
       <input type="hidden" name="contentId" value="${content.id}"/>
       <input type="hidden" name="sessionId" id="sessionId" />
      <input type="submit" value="提交评论" class="submit-on">
      </div>
               </div>
	    [/#if]
      
       </form>
       <script type="text/javascript">
    $(function() {
        //alert($.cookie("JSESSIONID"));
       $("#sessionId").val($.cookie("JSESSIONID"));
        Cms.comment(function(data) {
            if(data.status==0) {
                alert("评论成功");
                location.href=location.href;
            } else if(data.status==1) {	
                alert("验证码错误");
                $("#commentCaptcha").click();
            } else if(data.status==2) {	
                alert("内容不存在");
                $("#commentCaptcha").click();
            } else if(data.status==3) {	
                alert("评论关闭");
                $("#commentCaptcha").click();
            } else if(data.status==4) {	
                alert("需要登录评论");
                $("#commentCaptcha").click();
            }else if(data.status==5) {	
                alert("已经评论过，不能重复评论");
                $("#commentCaptcha").click();
            } else if(data.status==100) {	
                alert("内容不存在");
                $("#commentCaptcha").click();
            } else if(data.status==101) {	
                alert("评论不能为空");
                $("#commentCaptcha").click();
            } else if(data.status==10) {	
                alert("内容含有敏感词,不允许发表!");
                $("#commentCaptchaCsi").click();
            }  else if(data.status==6) {	
                alert("超过今日发表评论限制!");
                $("#commentCaptchaCsi").click();
            } else {
                alert("评论失败");
                $("#commentCaptcha").click();
            }
        });
    });
    </script>
    [#elseif content.channel.commentControl==1 && !user??]
    [#--登录评论，且未登录--]
    <div class="down clearfix">
    <img src="/${res}/images/userImg.png" class="userImg"><span>
    <a href="${base}/login.jspx?returnUrl=/">登录</a>之后才能发表评论</span>
    </div>
    [#else]
    [#--不允许评论--]
    [/#if]
</section> 


